import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'

// 引入子组件
import Index from '@/pages/Index.vue'
import Category from '@/pages/Category.vue'
import Order from '@/pages/Order.vue'
import My from '@/pages/My.vue'


Vue.use(VueRouter)
Vue.config.productionTip = false

const routes = [
  {
    path:'/index',
    name:'Index',
    component:Index
  },
  {
    path:'/category',
    name:'Category',
    component:Category
  },
  {
    path:'/order',
    name:'Order',
    component:Order
  },
  {
    path:'/my',
    name:'My',
    component:My
  }
]

const router = new VueRouter({
  routes
})

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
